package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.EsUserMapper;
import com.ruoyi.system.domain.EsUser;
import com.ruoyi.system.service.IEsUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 房产用户信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-05-26
 */
@Service
public class EsUserServiceImpl implements IEsUserService 
{
    @Autowired
    private EsUserMapper esUserMapper;

    /**
     * 查询房产用户信息
     * 
     * @param userId 房产用户信息主键
     * @return 房产用户信息
     */
    @Override
    public EsUser selectEsUserByUserId(Long userId)
    {
        return esUserMapper.selectEsUserByUserId(userId);
    }

    /**
     * 查询房产用户信息列表
     * 
     * @param esUser 房产用户信息
     * @return 房产用户信息
     */
    @Override
    public List<EsUser> selectEsUserList(EsUser esUser)
    {
        return esUserMapper.selectEsUserList(esUser);
    }

    /**
     * 新增房产用户信息
     * 
     * @param esUser 房产用户信息
     * @return 结果
     */
    @Override
    public int insertEsUser(EsUser esUser)
    {
        esUser.setCreateTime(DateUtils.getNowDate());
        return esUserMapper.insertEsUser(esUser);
    }

    /**
     * 修改房产用户信息
     * 
     * @param esUser 房产用户信息
     * @return 结果
     */
    @Override
    public int updateEsUser(EsUser esUser)
    {
        esUser.setUpdateTime(DateUtils.getNowDate());
        return esUserMapper.updateEsUser(esUser);
    }

    /**
     * 批量删除房产用户信息
     * 
     * @param userIds 需要删除的房产用户信息主键
     * @return 结果
     */
    @Override
    public int deleteEsUserByUserIds(String userIds)
    {
        return esUserMapper.deleteEsUserByUserIds(Convert.toStrArray(userIds));
    }

    /**
     * 删除房产用户信息信息
     * 
     * @param userId 房产用户信息主键
     * @return 结果
     */
    @Override
    public int deleteEsUserByUserId(Long userId)
    {
        return esUserMapper.deleteEsUserByUserId(userId);
    }
}
